package javacode.chapter04;

public class Example4_8 {
    public static void main(String[] args) {
        // 求1+2+3+…+100的值
        int sum = 0;
        int i = 1;
        for (; i <= 100; ) {
            sum = sum + i;
            i++;
        }
        System.out.println("1+2+3+…+100=" + sum);
    }
}
